package bg.amazone.simpleDB.jpa;
//http://code.google.com/p/simplejpa/wiki/GettingStarted
import javax.persistence.EntityManager;

import com.spaceprogram.simplejpa.EntityManagerFactoryImpl;
import com.spaceprogram.simplejpa.SimpleEntityManager;

public class UtilJPA {

	// Create EntityManagerFactory. This should be a global object that you reuse.
	private static EntityManagerFactoryImpl factory = new EntityManagerFactoryImpl("persistenceUnitName", null);

	public static EntityManager getEntityManager() {
		// Get an EntityManager from the factory. This is a short term object that you'll use for some processing then throw away
		EntityManager em = factory.createEntityManager();
		//SimpleEntityManager em = factory.createEntityManager();
		return em;
	}
	
	
}
